package com.py.pythink.controller;

import com.py.pythink.bo.RentAddBo;
import com.py.pythink.config.SystemConfig;
import com.py.pythink.entity.Rent;
import com.py.pythink.service.intf.RentService;
import com.py.pythink.vo.R;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author wsh
 * @date 2021/7/9 21:46
 */
@RestController
@RequestMapping("/api/rent/")
@Api(value = "",tags = "租房的新增和查询等")
public class RentController {
    //新增租房
    @Autowired

    private RentService service;
    @PostMapping("addrent.do")
    public R addRent(RentAddBo bo){
        return service.addRent(bo);
    }
    @GetMapping("select.do")
    //查看租房信息
    public R queryAll(HttpServletRequest request){
        return service.queryAll(request.getHeader(SystemConfig.USER_TOKEN));
    }
}